package com.gwnet.cabinet.service;

import com.gwnet.cabinet.client.ApiClient;
import com.gwnet.cabinet.domian.base.Result;
import com.gwnet.cabinet.domian.bo.GetBoxStatusBO;
import com.gwnet.cabinet.domian.bo.ManagerBoxesBO;
import com.gwnet.cabinet.domian.bo.OpenBoxBO;
import com.gwnet.cabinet.domian.bo.TakeBoxBO;
import com.gwnet.cabinet.domian.vo.BoxVO;
import com.gwnet.cabinet.domian.vo.OpenBoxVO;
import com.gwnet.cabinet.domian.vo.TakeBoxVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 外卖柜服务类
 * @author: WangLiang
 * @date: 2024/7/22 14:58
 */
@Service
public class ApiService {

    private final ApiClient apiClient;

    public ApiService(ApiClient apiClient) {
        this.apiClient = apiClient;
    }

    /**
     * 开箱-放入
     * @param openBoxBO
     * @return
     */
    public OpenBoxVO openBox(OpenBoxBO openBoxBO){
        OpenBoxVO openBoxVO = apiClient.openBox(openBoxBO);
        return openBoxVO;
   }

    /**
     * 开箱-取出
     * @param takeBoxBO
     * @return
     */
    public TakeBoxVO takeBox(TakeBoxBO takeBoxBO){
        TakeBoxVO takeBoxVO = apiClient.takeBox(takeBoxBO);
        return takeBoxVO;
    }

    /**
     * 管理箱门
     * @param managerBoxesBO
     * @return
     */
    public Result managerBoxes(ManagerBoxesBO managerBoxesBO){
        Result result = apiClient.managerBoxes(managerBoxesBO);
        return result;
    }

    /**
     * 获取箱门状态
     * @param getBoxStatusBO
     * @return
     */
    public List<BoxVO> getBoxStatus(GetBoxStatusBO getBoxStatusBO){
        List<BoxVO> list = apiClient.getBoxStatus(getBoxStatusBO);
        return list;
    }


}
